package main

import (
	"fmt"
	"time"
)

func main() {
	go test()
	go test2()
	time.Sleep(time.Second * 10)
}
func test() {
	for i := 0; i < 10; i++ {
		time.Sleep(time.Millisecond * 500)
		fmt.Println("hello")
	}
}
func test2() {
	defer func() {
		if err := recover(); err != nil {
			fmt.Println("test02出错", err)
		}
	}()
	var slice []int
	slice[0] = 1
}
